package model;

import java.util.List;
import java.util.Map;

public class Mynews {
	public void inserNews(String title,String content,String newspath,String createtime) throws Exception{
		String sql="insert into mynews(title,content,htmlpath,createtime)values('"+title+"','"+content+"','"+newspath+"','"+createtime+"')";
		Dbuit.execute(sql);
	}
	public List<Map> queryNews() throws Exception{
		String sql="select * from mynews";
		 return Dbuit.query(sql);
	
	}
	public String queryid() throws Exception{
		String sql="select LAST_INSERT_ID() as id";
		 return Dbuit.query(sql).get(0).get("id").toString();
	
	}
}
